//
//  WOPInstanceFactory.h
//  AtWork2
//
//  Created by lingen on 2020/2/4.
//  Copyright © 2020 Foreverht. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN


@interface WOPInstanceFactory : NSObject

+(instancetype)sharedInstance;

/**
 * 注册一个实现
 **/
-(void)registerInstance:(id)instance for:(Protocol*)protocol;

/**
 * 注册一个实现,并标明t自己实现的名字
 **/
-(void)registerInstance:(id)instance for:(Protocol*)protocol withName:(NSString*)name;

/**
 * 获取一个实现
 **/
-(id)getInstance:(Protocol*)protocol;


-(id)getInstance:(Protocol *)protocol withName:(NSString*)name;

/**
 * 是否有注入实现
 **/
-(BOOL)hasInstance:(Protocol*)protocol;

/**
 * 是否有注入实现
 **/
-(BOOL)hasInstance:(Protocol*)protocol withName:(NSString*)name;


@end

NS_ASSUME_NONNULL_END
